package StringDemo;

public class StringDemo2 {
    public static void main(String[] args){
        String str = new String("JAVA编程基础，我喜欢java编程");
        System.out.println(str.indexOf('A'));//返回index值
        System.out.println(str.indexOf("编程"));
        System.out.println(str.lastIndexOf('A'));
        System.out.println(str.lastIndexOf("编程"));
        System.out.println(str.indexOf("编程",8));
    }
}
